const { DataTypes } = require("sequelize");
const sequelize = require("./index");

const Type = sequelize.define("type", {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        allowNull: false,
        autoIncrement: true,
    },
    name: {
        type: DataTypes.STRING,
        allowNull: false,
    },
},{
    timestamps: false
});

Type.associate = function ({
    Product
                           }) {
    Type.hasMany(Product)
};

module.exports = Type;
